goods_list = [["清喜葡萄冻冻",16],["超级大瓜",20],["豆乳玉麒麟",14]]
shopping_list = ["1","2","3"]
goodsprice = [16,20,14]
while True:
    print("------茶百道-------")
    for i in range(3):
        print(goods_list[i][0],str(goods_list[i][1])+"元")
    balance = input("请输入您的余额"'(退出时输入Q)：')
    if balance == "Q":
         break
    print(f"{goods_list}\n")
    choose_goods = input("请输入商品编号进行商品的购买:")
    num = int( choose_goods)
    goodschosen_price = goodsprice[num-1]
    goodschosen_list = goods_list[num-1]
    print(f"商品总价是{goodschosen_price}"+"元")
    if int(balance) >= goodschosen_price:
        print("购买成功") 
    elif int(balance) < goodschosen_price:
        print("余额不足，购买失败")
    balance = int(balance)
    balance -= goodschosen_price
    print(f"您购买的商品：{goodschosen_list}\n您还有{balance}"+"元")
    break